package datas;

import java.util.ArrayList;
import java.util.Collections;

public class Sequence extends ArrayList<Integer> {

	public Sequence(ArrayList<Integer> _l) {
		super(_l);
		
		Collections.sort(this, Collections.reverseOrder());
	}
	
	public boolean admissibleFor(int _n) {
		return (this.getNorm() == _n);
	}
	
	public int getNorm() {
		int sum = 0;
		
		for(int x: this) 
			sum += x;
		
		return sum;
	}
	
	public int getLength() {
		return this.size();
	}
	
	public String getNormalizedString() {
		String ret = "";
		
		for(int x: this) 
			ret += x + ",";

		return ret.substring(0, ret.length()-1);
	}
}
